package com.ratta.supernote.note.plugincore.api;

import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReadableMap;
import com.ratta.supernote.note.plugincore.core.PluginAppAPI;
import com.ratta.supernote.note.plugincore.core.entrance.EditBarEntrance;
import com.ratta.supernote.note.plugincore.core.entrance.SidebarEntrance;
import com.ratta.supernote.note.plugincore.error.EnablePluginException;
import com.ratta.supernote.note.plugincore.ui.menu.PluginEditMenuItem;
import com.ratta.supernote.note.plugincore.ui.menu.PluginMenuItem;
import com.ratta.supernote.note.plugincore.ui.menu.PluginSideMenuItem;

import java.util.List;

public abstract class PluginEntranceAPI {
    
    protected static PluginEntranceAPI instance;

    public interface PluginSideBarCallback {
        void onChange();
    }
    public static PluginEntranceAPI getInstance() {
        return  instance;
    }

    public PluginEntranceAPI() {
    }

    /// Need to initialize by calling init in Application
    public static void init(PluginEntranceAPI pluginEntranceAPI) {
        instance = pluginEntranceAPI;
    }

    public abstract void init();


    public abstract void deletePluginMenuItem(String pluginID);

    public abstract void enablePluginMenuItem(String s);

    public abstract void disablePluginMenuItem(String pluginID);

    public abstract void registerMenuItemRes(PluginAppAPI pluginApp, double type, ReadableMap menuItem, ReadableMap showData, Promise promise);

    public abstract void registerSubMenuItemRes(PluginAppAPI pluginApp, ReadableMap menuItem, ReadableMap showData, Promise promise);

    public abstract void unregisterPluginMenuItem(int id, String pluginID);

    public abstract void modifyMenuItem(PluginAppAPI pluginApp, ReadableMap menuItem, ReadableMap showData, Promise promise);

    public abstract List<PluginSideMenuItem> getPluginSideMenuItemList();

    public abstract List<PluginEditMenuItem> getPluginEditMenuItemList();
    public abstract void updateUseTime(PluginMenuItem pluginMenuItem);
    public abstract void addPluginSideBarCallback(PluginSideBarCallback pluginSideBarCallback);
}
